<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>获取全部基金代码</title>
</head>
<body>
    <h1>获取全部基金代码，并同步到数据库</h1>
    <script src="http://127.0.0.1:7001/static/fund/fundcode_list.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
    <script>
        console.log('ceshi',r)
        var fundArray = r;
        var fundType = ['债券型','混合型','股票型','股票指数','QDII','ETF-场内','QDII-ETF'];
        var array = [];
        fundArray.map((item) => {
            let itemType = item[3];
            // 只保留基金、名字、类型
            let itemObject = {
                code: item[0],
                name: item[2],
                type: item[3]
            }
            if (fundType.includes(itemType)) {
                array.push(itemObject)
            }
        })
        axios.post('/v1/reptile/postFundCodeToSql', {
            fundCodeArray: array,
        })
        .then(function (response) {
            console.log(response);
        })
        .catch(function (error) {
            console.log(error);
        });
    </script>
</body>
</html>